package Operation;

import book.Book;
import book.BookList;

import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 86183
 * Date: 2023-12-31
 * Time: 22:08
 */
public class AddOperation implements Operation{
    @Override
    public void work(BookList book) {
        System.out.println("请输入要新增的书名");
        Scanner scanner=new Scanner(System.in);
        String name=scanner.nextLine();
        System.out.println("作者");
        String author=scanner.nextLine();
        System.out.println("类型");
        String type=scanner.nextLine();
        System.out.println("价格");
        int price=scanner.nextInt();
        Book book1=new Book(name,author,price,type);
        int size=book.getUsedSize();
        book.setBook(size,book1);
        book.setUsedSize(size+1);

    }
}
